package com.youyicloud;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ImportResource;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.client.RestTemplate;

import com.aliyun.mns.client.CloudAccount;

import springfox.documentation.swagger2.annotations.EnableSwagger2;

@EnableSwagger2
@ImportResource(locations={"classpath:kaptcha-config.xml"}) 
@EnableEurekaClient
@EnableScheduling
@SpringBootApplication
public class AliApplication {
	@Value("ali.accessKeyId")
	private String accessKeyId;
	@Value("ali.accessKeySecret")
	private String accessKeySecret;
	@Value("ali.accountEndpoint")
	private String accountEndpoint;
	
	
	@Bean
	public RestTemplate restTemplate() {
		return new RestTemplate();
	}
	
	@Bean
	public CloudAccount cloudAccount() {
		CloudAccount account = new CloudAccount(accessKeyId,accessKeySecret,accountEndpoint);
		return account;
	}
	
	public static void main(String[] args) {
		SpringApplication.run(AliApplication.class, args);
	}
}
